package com.brillilab.service.core.experiments;


import com.brillilab.domain.po.experiments.Experiment;
import com.brillilab.domain.po.kit.Kit;
import com.brillilab.domain.po.topics.TopicExperiment;
import com.brillilab.domain.vo.experiments.ExperimentIconListVo;
import com.brillilab.domain.vo.topics.ExperimentDateListVo;
import com.brillilab.domain.vo.topics.TopicExperimentResultVo;

import java.util.Date;
import java.util.List;

/**
 * 新实验
 *
 * @time 2019/09/05
 */
public interface IExperimentService {

	//****** 老逻辑 可用 *******/
	Experiment getUnderWayOrNotStarted(Long experimentTargetId);

	Experiment selectExperimentByStepId(Long stepId);

	List<Experiment> getListByDescEndTime(Long topidExperimentId);

	List<Experiment> selectByIdsAndNotEnd(List<Long> experimentIds);
	//***** end *****//

    List<Experiment> getListByTopicId(List<Long> topicIds);

    List<Experiment> getPlanExperimentListByLabId(Long labId,List<Long> executorIds);


    List<Experiment> selectByIds(List<Long> experimentIds);

    /**
     * 根据成员Id和实验状态提供
     *
     * @param labMemberId 主执行人
     * @param state       实验状态
     * @return
     */
    List<Experiment> getExperimentByStateList(Long labMemberId, Integer state);

	/**
	 * 根据条件获取实验列表
	 * @param labMemberId
	 * @param stateList
	 * @return
	 */
	List<Experiment> getExperimentByConditionList(Long labMemberId, List<Integer> stateList);

	List<Experiment> getExperimentList(Long labMemberId, Date beginDate, Date endDate);

    /**
     * 根据id获取实验
     * @param experimentId
     * @return
     */
    Experiment selectById(Long experimentId);


	boolean updateById(Experiment experiment);



	int getCountByTargetId(Long targetId, List<Integer> states);


	List<TopicExperimentResultVo> getExperimentHistory(Long topicExperimentId);


	int getCountByTopicExperimentId(Long topicExperimentId, List<Integer> states);


	List<ExperimentDateListVo> getExperimentDateListVo(List<Long> topicExperimentIds,Long targetGroupId);


	List<ExperimentIconListVo> getExperimentIconVoList(List<Long> experimentIds);


	List<Kit> experimentKitList(Long experimentId);

	Experiment experimentAdd(TopicExperiment topicExperiment);

	void updateByNewMethod(Long executorId);

	List<Experiment> getExperimentList(Long topicTargetId);

	List<Experiment> getExperimentList(Long topicExperimentId,Integer state);

	void endExperiment(Long experimentId,Integer isExpect);

	 List<Long> selectIdByTopicIds(List<Long> topicIds);


	int getExperimentCount(Long labId);

	int getExperimentCountByExecutorId(Long labMemberId);

	List<Experiment> selectLastExperiment(Long experimentId);

    Experiment insert(Experiment experiment);

	List<Experiment> getPublishList(Long topicExperimentId);

	/**
	 * 实验评价设置
	 * @param experiment
	 */
	void evaluationSetting(Long experimentId, Integer result, Integer publish);
	
	/**
	 * 实验指导设置
	 * @param experimentId
	 * @param type：1分组，2分析后数据，3trouble
	 * @param operate：1添加，2导师查看
	 */
	void experimentGuideSetting(Long experimentId, Integer type, Integer operate);

	void deleteByIds(List<Long> experimentIds);
	
	void deleteById(Long experimentId);

    List<Experiment> selectIdByTopicIds(Long topicId);

	List<Experiment> selectByTopicTargetId(Long topicTargetId);
	
	/**
	 * 获取最新一次实验
	 * @param topicExperimentId
	 * @return
	 */
	Experiment getLatestExperiment(Long topicExperimentId);

	void delete(Long topicDirectionId, Long topicTargetId, Long topicExperimentId);

	void endExperimentByTopicId(Long topicId);

	/**
	 * 获取要指导的实验列表
	 * @param labId
	 * @param labMemberIdList
	 * @return
	 */
	List<Experiment> getGuideExperimentList(Long labId, List<Long> labMemberIdList);
}
